package com.yixiu.study.juc.queue;

import java.util.PriorityQueue;

/**
 * @CalssName T05_PriorityQueue
 * @Description
 * @Author yixiu
 * @Date 2021/6/29 9:54
 * @Verison 1.0
 **/
public class T05_PriorityQueue {

    public static void main(String[] args) {

        PriorityQueue<String> q = new PriorityQueue<>();
        q.add("c");
        q.add("e");
        q.add("a");
        q.add("d");
        q.add("z");

        for (int i = 0; i < 5; i++) {
            System.out.println(q.poll());
        }
    }

}
